package day_2022_9_to_12.Day;

/**
 * @author haomin
 * @date 2022/09/26 08:57
 **/
public class Day25_1_Op17_19_MissingTwo {
    class Solution {
        public int[] missingTwo(int[] nums) {
            int[] res = new int[2];
            int[] data = new int[nums.length+2];
            for(int num : nums) data[num-1] = num;
            for(int i = 0; i < data.length; ++i){
                if(data[i] == 0){
                    if(res[0] == 0) res[0] = i+1;
                    else res[1] = i+1;
                }
            }
            return res;
        }
    }
}